Added more tests to check that the default port is returned when explicitly set
Fixed code that was returning always 443 when the port was explicit