Date calculation fixes.