Merge changes I81fc2f90,I5e7fd759

* changes:
  Using proper key for removing from map.
  Removing wrong equals method in comparator.