some import fixes on Python2 + misc stuff