Fix issue #114. Keep track of previously visited dirs in visit.