Various fixes

Mostly permissions fixes