Fixed bug in TemplateUtil when passed null or undefined values for output.