Fixes ArrayIndexOutOfBoundsException while sending big objects from Java to R