Made ha_tools work with Py3