Ask students to contribute to a class list of appropriate group behaviors. Display the list and remind students to use them. Add to the list as needed. Letting students choose their own groups. We would all choose our friends to work with if given the choice.
Friends often get off-task.
Students need to develop positive working relationships with all class members. Randomly assign students to groups. Change groups often enough so no-one gets stuck for long periods with a difficult class member. Not doing cooperative activities often enough for students to develop cooperative skills. Have students do something cooperative at each class session to reinforce positive cooperative habits.