Fixes to jinja2 integration