Made some changes to Cmake
Fixed some problems with test