Transform type and texlength_t bugs fixed