Fixed bugs: group detection