Fixed various CMake problems