Fixed the wrong index calculation in tinyMCE (see #2)