Corrected more memory leaks in det_depends
Fixed even more memory leaks!