Collect stderr and stdout.