Fix replacers being picked if whatProvide was called before building the package whitelist, fixes #2991, fixes #2962