Added better handling of date fields.