Fix python bindings for Python 3