Fix potential crash.
Make view range persistent.
Improve the accelerometer sensor interface.