Fix bug in saving undo states; #1160