Fix RawBytes support, and avoid unnecessary allocations.