Check is_object before passing into get_class - fixes #3

Issue #3