Much work on bug #8088.  It will now pick out ports automagically.