Fix for documentsContained bug