Fixes for python3