Revert "Revert "Fixed perms""

This reverts commit 2932651d0c3a570322a40b63ab3f17948cb4bc18.