Fixed some bugges in reduce phase.

The fixed version can cache the shuffled intermediate data better, and
can decrease the stragglers to some extend.