Add more tests for equiv* and fix bugs