proxy port handling corrected for tests.