Add install for CMake.
Fix some bug.