Significant updates and fixes with template and element tags