Cherrypick of two changesets from Fixes/0.26 to Master

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