Several flaws in CMake corrected

There were certain inconsistencies found on CMake.