Redirect stdout and stderr