Simplify and correct comparisons with None.