Added workaround for opening files under restricted privileges.