Added support for redirecting stdin/out to files.