Bug correction in token regeneration