minor updates to scanner.c get_char and loop conditions