runtime: Fix crash/hang when processing nodes which are not connected
tests: Fix spurious failure in output checking code