Fix indexing errors in scanner
Quit when input is exhausted
Inject some garbage bytes into generated test data