Use Jinja2 length instead of python len

Fixes #751