fix some jinja bugs