ByteArray class implementation has bugs.