Fixing bugs and and permissions