Cmake and warning fixes