BUG: Various minor CMake related bugs and style fixes