Fix stdout/stderr trapping.