Fix map reduce backport

Fixed #2354