This fixes an issue when a subdir has the same name as its parent, it would get exluded from the list.