Port any relevant changes in https://github.com/sillsdev/machine/pull/399 from machine to machine.py. <!-- AUTO-GENERATED-ISSUE -->