Fixed small bug in the UndoRedoHandler

To reproduce:

1. Open file, change it and save the change
2. Open different file

=> New file appears to be changed as well even though
   it is not

Should be fixed now...