Fixed problem for templates without id attributes.