Handle OS errors more gracefully [#238]