Fixed bug when decoding undo data.
Only push to the undo buffer when there are changes made.