bug fixes to io