Fix potential issue with early branching points before end of flanks; more important with early termination of loops.