Correct date comparisons
Revised