fixed endless loop bug when template contains unclosed curly brace
Merge pull request #4 from owenyang0/endless_loop_fix

Endless loop fix