Fixed bugs in notify mode and with magnetometer