Improvements on permission command.
Removed dead code and cleaned up things.
Removed little issues in FlatfileProvider.