Fixed bug in date serialization