Bugfix: correct file handling on wrong permissions.