fixed bugs, passed 77-file-io.t