Fix permissions and ownership