Index calculation bug resolved.