Bugfix for Python 3