Fixes some bugs in CMakeLists.txt and debian files