Fix a parsing bug that prevents IPv6 addresses from being used with `add_host`.