Fixed TOC closest index issue