check if obj is an object
Merge pull request #3 from blackvladimir/master

check if obj is an object, and raise meaningful exception