Fix warning about elementwise comparison to 'None'.
Merge pull request #482 from hadjimy/comparison_to_None_fix

Fix warning about elementwise comparison to 'None'.