Dynamically choose ports (issue #4)