Better handling of HOST extraction given a URL. Does not cause errors if
any other part of the URL has illegal characters