fixes for Python 3