Fixed minor bug with the port assignment method