Fixed the bug with stdout/stdin to/from file