Fixed Date object bug in compare dates