Fixing small IO bugs