scanner, parser fixes