Fix FutureWarning from numpy

Fix the following warning from numpy 1.9.0:
"FutureWarning: comparison to `None` will result in an elementwise object comparison in the future."