Improved the UndoRedoHandler

There was a small bug in the routine determining whether
a file is changed. To reproduce: Perform an action, save,
undo and redo. The file shows up as changed even though
it is not. Should be fixed now.