Fix not correctly connecting to socket server.