Fixes for python3.x