Fix unbalanced template tag