further improvements to aggregate query support