fixed crash when using the template-tool

The template tool crashed when used on anything.