Fix group indexing