Better handle wildcards.

See also discussion in cms-sw/cmssw#5