Fix stdout/stderr capture with passed tests