Changed `... == None` to `... is None`.

Fix the FutureWarnings from numpy w.r.t None comparison.