Bug fix in date range validation