Enhancing subdir check to deal with substring-ed dirnames