Fix date parsing and tests