fix issue 812:  only walk the first/shallowest version of each package

Hopefully fixes issue #812.