Backport editors/mg fixes from trunk.