Further fixes for python3