Some cleanup
Restore layer permissions settings