Fix outerTpl bug