Correcting stdout redirection