Only increment index if lines were generated.