Fix for date calculation.