fixes several bugs in groups