Merge change 2593 into donut

* changes:
  Bug fixes and performance improvements