Fixed check that given date is valid