Fixing grouping when calculating success rate