Reintegrate the last change of AutoEditTest (Gavin's version)