Fixed error in calibration distance to line segment code.