Some minor fixes to date parsing