fixed some python3 compability issues