Fixed CMake and compile errors on Linux