I fixed copying group selections, now they first sort the elements by z-index, then copy them.