fix some previously introduced CMake bugs