Fix port handling.