This commit enables template debug option to detect errors
in template rendering in unit tests.
Several errors in template rendering are found by enabling the
debug option and they are fixed in this commit.
Related-Bug: #1809983
Change-Id: I1a2d19f2eae62e16f02d3386abd65527bac4e7a0