Properly serialize nullable ints and floats