io.c fixes