Fixed bug in permission persistence.
Improved permission manager.