Corrected implementation of datetime serialisation support