Fixed loop generation with unit branches.