Cherrypick of two changesets from Fixes/0.26 to Fixes/0.27

Cherrypick of two of my earlier changesets from Fixes/0.26.