Fix some warnings, remove an useless line from CMakeLists.txt and some cosmetic fixes.