Fixes to registering and permissions