Fixing cmake bugs