Fix a couple of bugs in date parsing.