This commit fixes an issue introduced in the recently released Hugo 0.22. This logic did not handle the case with root sections with non-section subfolders very well. Fixes #3586
Fixes #465