Fixed respecting dangerous while applying template

Closes #1251