Fixed some more issues with the template conversion