Fix port assignment.