Fixing redirection of stdout.