Fixes to the initial batch of unit tests in TemplateTest.php