Fixes issue when serializing large arraybuffers