Fix receiving data from socket and implement input decuplication.