Fix building of element attributes