Fix error on empty template
Merge pull request #49 from jcheng5/master

Fix error on empty template