Update type cast functions