Fixed bug in size calculation of the slices ByteBuffer