Fix bug in walk() noticed by tests.
Fix bug in walk() noticed by tests.

relic7/prodimages,benhoyt/scandir,relic7/prodimages,relic7/prodimages,relic7/prodimages,benhoyt/scandir,relic7/prodimages,relic7/prodimages