minor bug with template parsing