Correct a bug in the datetime serialization.