Corrected error calculation.