Added support for optional GID when leaving a group