Fixed a division by zero in calibration