fix bug in self-provides extraction code