Correct minor logic bug with externalSwap flag