Fixed the `QM.mapreduce` function