Improved handling of error vs valid response.