Added checks on possibile errors during calibration function doneRaw()