Added doc.destroy() to replace collection.destroyDoc. Added more cleanup code