fix bug of extend and exclude-dir match.