Added fix for when the class has an element and attribute with matching names.