Fixed a bug when endpoint doesn't have port at all (e.g inproc)