Fix bug with date generation.