Turn KeyError into AttributeError instead.