fix more file I/O stupidities