Fix to calibration.cpp and script