Fixing magnetometer initialization conditions where the sensor fusion failed