add cast functions for the nullable primitives