Fix bug in python3 version.