Changes to template handling.