Some improvements to handling of raw sensor data and cleanup.