Fix major bug in scanner, check PR