Fix error in date math.