More detailed and defensive testing on messages from the server.