Improved compatibility with twig templates

Fixes: #12, #13