Fix NumPy 1.9 warnings for "== None" comparisions.