Fix more bugs in TextRenderer