Pow also returns nan if either base or exp is nan so that would already be handled; but if it's an unevaluated Pow like Pow(nan, 3, evaluate=0) then it will become evaluated (thus becoming a nan) and added to seq and be processed as nan when it's encountered. (That shouldn't happen -- it should remain unevaluated -- but even if it wasn't re-evaluated, I don't think nan**3 should trigger the return of nan from flatten.) The unevaluated Mul is handled correctly currently:

```
>>> Mul(3,nan,evaluate=0)+3
3 + 3*nan
```

I think this location is the right place. We can change it if we find that we missed something. But everyone is pretty concerned about flatten not becoming more bogged down so I think we should try be as conservative as possible.