Fixed flatten & order by