Permission fixes.
Merge pull request #487 from Tivix/master

Permission fixes.