fixed possible bug on UndoManager in MT environement.
bug fixes.
Merge branch 'develop'