More python3 adaptation