Fix up a bug on successive foldings.