Fixed some bugs with the twig provider