Fixed applying template restricting dangerous functions