Better error handling in _AttrDict