Fix assertions in testEquivalence and beef up the test