Trailing slash and port fixes