CMake fixes for IPv6 and other fixes