Fix Python 3 implementation of ByteArray.