Fixed a small bug with undo related to having duplicates of the initial
state being stored.