Fix getting last tick of sensor