Fixed calibration bugs