Get aggregation working using melt/cast