Add reduce optimisation back.