Patch from Tim Kosse: check back->exitcode() in both loops on