Fix a couple of bugs in MapReduce
Merge pull request #2 from TriKaspar/master

MapReduce