Add check for unexpected return values.
Add notes/protocol.md