better base type support and some other python 3 fixes