Fixed a bug in computeError