Group primitives were incorrectly sorted

When defining a group, order of primitives is important as it defines start/stop order of your primitives. Sorting the primitives array caused primitives to be grouped in an undesired order, resulting in unwanted behaviour.