Fix problem with incorrect port being used when entering URL without trailing slash