Comparator was changed (sorting of null values): for the equal frequencies it returns left.value() < right.value(), where  the null value is the smallest one.