Fix CS + reduce branch depth
Reproducing test case for #6279