Fix comparison with None for Py3