fixes for tests to support changing ports