Adjustments to calibration functions. Fixed relative motion of X and Y in buildgrid().