Fixed bug where dirty state wasn't set to false when undoing to the first undo level.