Small changes to date handling