Fixes duplicate test runs introduced in: !2709 (merged).
Also adds more debug output to the terminal.