Compare values in TreeMap's 'lt' function

Closes #5194