Fix date detection