Fix the environment of the jinja2 templates.