Error checking for invalid dates.