Avoid comparing NumPy arrays with None.

Recent numpy versions give warnings about changing to elementwise
array comparisons in the future.