Simplify check_targets_are_reached a little bit.