Fix #697: fix TypeError when accessing an unhashable global in object mo...

...de