fix trailing slash & port in netloc problems