Fixed bugs where group names were not encoded correctly