Fixing some corner case issues with file permissions when server is deployed the first time