Selective undo detection corrected.
NullPointerException bug fix