Fix error checking for sensors.