Fixed problems with CMake build and some syntax errors in code.