Fixed pipe to output redirection bug