Fixed log messages for hierarchical test

The logging for hierarchical tests was slightly broken so that the
test header would get printed after the output for the first phase
of the test, where we check whether we can reach the first word
from the second. Simple rearrange.