Bugfix for python3 support