First changes due to porting lib to python3