Added debug message
Fixed a bug
Improved CMake scripts