Tidy up to fix undo back to original state