Fix #1 for python3 support