Fixes for python3.