Handle OSErrors properly.