Bug fix: record errors'  stdout as well as stderr