fix(scanner) fix some scanner bugs