PY3 Fix compilation in Python 3

Also removes unused variable.