Merge change 2766 into donut

* changes:
  Manually merge a few fixes from cupcake and cupcake_dcm.