Changed MagneticFieldSensor to singleton.