Fixes file permissions