Simulator fixes!

Fixed memory bug with aggregation framework