fixing up some attribute removal for templates