Fix regression in undo.js