Slight scanner and parser error handling improvements