Fixed a bug with NaNs in error spectrum