Improve virtual port handling