minor fixes for date calculations