More python 3 fixes for bitcoin.py