Fixed bug in repair of tokens.
Merge branch 'test' into dev