Use not instead of direct compare to none.