Refractor code. Fix compile error.
Fix clang compile error.
Fix bug in unify.