Don't template 'vars' dictionary during templating

Fixes #9132