Jinja2 corrections and extension