Fixes on permissions and templates