Fix bug where total tokens was wrong
Revert "Fix bug where total tokens was wrong"

This reverts commit 4e8580ca1651feb27efbdef45b73693c72e97f62.
Revert "Revert "Fix bug where total tokens was wrong""

This reverts commit cdce0172943b4e19a89b5876aceca78dc16120f4.