Merge pull request #713 from houqp/master

two bug fixes
fix bug in TOC construction in cre.cpp

first toc entry should start with index 1 instead of 0