Fixed potential bug with the sorting of the key-value pairs throughout
implementation. They all use MeasureComparison now.

Change-Id: I9d26d363b4843714ac365b1ed2ba632e50308fa9