fix on comparators to deal with null values