Fix conversion of histogram inner aggregations

Closes #1079