Fix improper parsing of hostname. Better regex.