Fixes bug when creating Selfhost with URI including "localhost" in domain name.