Fix attribute_iterator and find_variant methods to work when called from a variant.