Fix aggregate

I clearly didn't know what I was doing. Also simplifying some tests. 

Fixes #646