Fix bug where port argument was ignored