Fix date compare when null