Improve handling of empty responses