Fixed wrong index substringing BEGIN|token|END