Calibration of devices