Make model validation error message formatting more robust