Fix comparison with None type