Editor: make execute and undo code more consistent.