Fixed a bug in calculating errors of the A/C.