Fixed incorrect behavior of comparisons. Added a comment about the relevant invariant.