template.name may be something other than a string.

Fix #389.