Check for IPv6 correctly.

- This does not fix the the IPv6 problem with plugins, but it's a start