Seriously fix the port assignment bug.