Fixed a fault in Sensor.cpp