Fixed CMakeLists and packages and cleaned up code