Fix for comparing dates