Karl Smith modifications
Handle separately stderr and stdout