Some date-related fixes