Fix getTemplate() issue which caused an undefined variable to be called.
Merge pull request #1127 from elinw/templateparams-roberto

Fix getTemplate() issue which caused an undefined variable to be called.