Fix date/timestamp handling