Make multiple undoes and redoes work.