Fix more compilation errors with CMake