Fixed a bug where invalid file permissions could throw an exception which wasn't caught before