Better handling of error response while indexing. Fixes #65