Improve handling of empty responses

[#65341064]