fixes related to template (pt 2)