Fix edge cases in HLL folding