Add more error codes and message, reflow some doc comments.

Should be ErrKeyMismatch.