Added an additional check to GetGroupPeerPublicKey