Fix tags and add support for filtering out deleted documents.