Moved closing process' stdin before stdout.