using AggrKey for MapReduce + small bug fix