fixed bugs for camera calibration