fixup file handles