Fixed templates so that attribute namespaces can be set
Fixed missing variable declaration
Got unqualified element parameters to be actually unqualified