Compile fixes for python3