adding key object, and improving error messages.
Merge pull request #201 from proverma/master

adding key object, and improving error messages.