Fix date pair and improve date handling