fix a sorting bug and correct agg switch id problem
2 files changed