math.statistics: Fix histogram and collect. Histogram used each-index even when it didn't need to.