Fixed bug in date munging