Changes to connect() and listen()