Fix issue where searches started at a directory with no subfolders would return an empty array