Fixed CMakeLists.txt and compilation warnings