Fix InvalidOperationException in LookupParentFolders.