fix more io bugs
Merge pull request #9 from bcarancibia/master

fix more io bugs