Fixed bug in reduce shim