fix infinite recursion in dirwalk

also remove two redundant tests