Added depth limit to tree and catched delete exceptions