removed O_BINARY
more cleanups