fix port argument handling in _connect()