Fix a UI bug and a bug in CMakeLists.txt