Fix error with long aggregates (week/month)