Implement StringAggregator and Aggregate and fix some minor bugs