some more work on sanity checking of the AST