Fixing variable reference in template.