Fix marshalling functions using TypedArray.set, since it performs miserably