Some I/O fixes.