Fixed simple-measures aggregations and added tests to catch bugs