Py3k compatibility fix