fixed more templating bugs