Fixed applying template / dangerous functions
Fixed default on demand restricting / dangerous functions