Fix a bug with comparible types (None is not comparible in python3