Fix comparisons against null
Merge pull request #1278 from systay/null_comparisons

Fix comparisons against null