Handle array param values and sort after encode