Fix for: Connection fails when port is specified