Done flag debug lexical error fix