Added a fix for misconfigured servers that have port as part of hostname