Fix case with wrong or empty date fields.