Removed comparisons with None

Fixes issue #2258