fixed python3 incompatibilities
fixed python3 incompatibilities