Fix sensor type cast