Appveyor and CMake fixes