Fixing date and datetime fields