Added port instvar

And using port randomly in tests.