Fixed bug in which documents inside directories were ignored.