Finally fixed CMake issues