Fix stdout / stderr redirection for shell