Removed comparisons with None

Fixed #2258