Improved compatibility with twig templates