Use private template name property directly

Fixes TypeError: 'undefined' is not an object (evaluating 'type.template.kind.replace')