Various fixes (permissions, template)