Text rendering and various fixes