fix unification bug and add some test cases