Improved handling of file permissions during installation