Issue #1307890 by neilnz, Dave Reid: Improved performance of token_replace() on strings which do not contain any tokens. Fixed bugs with token_scan().