Fix aggregate table bug #1364

Fix aggregate table bug