Fixed a bug where tokens were not being regenerated properly.