Avoid duplicate of base directories with subdirs. Fix test on OS X