Restore elements order as they used to be in 2.2.

Should take care of #11262