Some more fixes in cmake buildsystem