bug fixes in date parsing