Fixed delete recursive call
Other bug fixes