am 36d44740: Merge "Fix a bunch of small system/core bugs."

* commit '36d44740dd045403ae615b8dd6dac8b9a4e9f5bf':
  Fix a bunch of small system/core bugs.