Fix CMakeLists.txt, add some -W flags, fix warnings, generated by this