fixes for python3 compat