Handle weird port calculation.