Set the parent for newly created RGs. Be more robust if an RG has no parent. Test creation of an RG. Fixes #1718 and #1719. - Legacy-Id: 9661 Note: SVN reference [9650] has been migrated to Git commit b9bf7594001f0014ff4c2ac3688b431f1fcd39ec