Fix reduce regression 13304.

Also cover test case 10709.
Merge pull request #2431 from monarchdodra/13304

Fix reduce regression 13304.