Merge change 1673 into donut

* changes:
  Made valgrind optional. Capture the target output.