Fix a few more errors in I/O layer