Fix a couple of issues with the CMake script