Fix char code bugs in Scanner;  Improve performance testing scripts.