fix for correct byteOffset handling