Improve I/O tests