Bug fix with dates