Replaced some RuntimeErrors by more sensible IOErrors