Catch OSError when checking for permissions
Merge remote-tracking branch 'chiiph/bug/catch_oserror' into develop