fix python 2 compatibility, fix module loading