Fixed deleting documents.