Fixed a bug in the assignment of the connection to a remote server.