cmake and some more fixes