Improve stdin, stdout, stderr management.