test fold permutations with various maxOverflow / offsets
don't discard current maxOverflow if offset is high enough
fix issue when offset changes folding maxOverflow
minor optimizations