fixed RLE for heap