Add more error codes, messages and error checking.

True, it returned that error because now at least three keys have to be there. I'll add more key data and expect the right errors.