Fixed Dates.cpp to avoid floating point problems