Fixes and add CMakeLists

Well title says it all