Rewrote ByteVector::replace() simpler