PY3: changing None to 0 to ensure comparability in py3