fix comparator handling nulls