More safely check for a hash-like object. Fixes #66