fixing types and import names for Python 3