Fixed bug in scanner.