Handle null keys in hash-based comparator, and add tests for collisions
Small optimization
tweak