Fix bug with closure as twig function