improvements to equivalence merging