Fix loading history

Changes to support undo broke loading history.