Fix file permissions and user agent