fix some bugs in CPANIDX code