fix Dict object, raise AttributeError rather than KeyError