Fixed an indexing error in group position