fix some ridiculous bugs in scanner