Computation of aggregate stats using QgsSpatialIndex; fix updating attributes