Date field fixes

Date field fixes for #388 and a postgres issue