Fix bug causing sensors to stop working