Calibration and some cleanup