Improved handling of text