NicolasC your loop actually runs too far, it should stop at (re.NumRenderElements() - 1).
Sorry I don't follow you on that point ?