Added error message formatting