Fix Py3 NoneType fail