Fixed bug in comparator class which caused compare to violate transience contract