aggregate(): fix when zero measures; optimize when only one dimension