Improved error messages and less crashes on bad text input.