Fix permissions and format check