Improved the client's handling of incoming messages.