Fix output redirection