Fix inspection of the stack if the 'self' object has no __dict__.