fixed bug in tpl-engine that ate characters when '%', '{' or '[' appeared without closing token