Fix texttool, increase performance