Fixed bug in calculations of what should run

If no direct dependent of a task should run, but some further upstream
should, they wouldn't be scheduled. Now all tasks downstream from a
task that should run will be scheduled.