fix variables in templates