Rewrote undoable actions to allow for ID rewriting.