Fix bug in CMake script