Dynamic aggregation tested

Fixed known bugs of dynamic aggregation. The current version works
fine under repeated stress test.