Fix a client-server communication.
Add tests