Fix permissions script