Correction to take in account that the last layer is also included in the residuals...