CMake scripts fixes