Improved error message formatting.