Fix date parsing, clean up syntax