More detailed and defensive testing on messages from the server.
Merge pull request #396 from monkeyiq/2013marcollab3

Collab: More detailed and defensive testing on messages from the server.