Fix ClearGroup and SetGroup crash