Replace is_null() with === / !== NULL

Exact same behavior, but faster. I also think it's more readable.
A few adjustments to previous commit
Merge pull request #2152 from vlakoff/develop

Replace is_null() with === / !== NULL