Fixed error when saving groups