Fixed issue with dependencies triggering before needed.

Still need to fix issue where a -> b -> c -> d generates an awful graph.