Rework automatic jail/port selection logic