fix totex.cpp