Preserve indexes when folding variables.