Couple of bugfixes for CMake code.
Merge pull request #179 from Fraser999/MAID-534_bugfix

Couple of bugfixes for CMake code.