Code simplifications. Dates equality comparisons fix.