fix bug in date field
improvements on tests