Port un-ported changes from https://github.com/sillsdev/machine/pull/402.
Port un-ported changes from sillsdev/machine#402.