Aggregations parsing is too lenient.

Close #5827