Fixed bug in TemplateCompiler