Reworked the dependency walking to be more resilient. Closes #186