Fixes object delete and undo method.
Added recursive delete and undo.