Various python3 fixes.