Merge branch 'jc/maint-template-permbits' into maint