Added a getPort function.