Fix in auto magnetic calibration

Fixed not being able to disable auto magnetic calibration. Also, some
really bad pointer handling on my part.