Better handling of non-JSON responses.