Fix optimization when looking for attributes with any name ('*').