Stop visiting the same dependency multiple times sometimes
Stop visiting the same dependency multiple times sometimes

Specifically, update the "already visited" list completely *before*
recursing, so each recursive call has the full list, rather than
*during* recursing, so all recursive calls (except the last) have an
incomplete list.

macro187/nugit