Fixed a py3 bug