Fixed a bug computing the reconstruction error