Added check for object actually being an object
Added additional check for child objects
Merge pull request #2 from gbenvenuti/master

Added check for object actually being an object