Fix date handling