Fix problem where port was not extracted from URI