Merge in accelerometer fixes from master