Fixed bugs when passing an IPv6 address as host