Avoid false positives by comparing AST first