Fixed outOfRange bug with calibrate