rejigged stdout/stderr processing a bit