Fixed redirection of input/output streams based on atoi(argv[1]) values.