Fixed some minor IO bugs.