Fixed bug in repair of tokens.