Fix variables access in templates.

Hello,
This should address deprecated variables access in templates.