Resource index - allow a retry to get results.
Resource index - fix bug for empty ontology selections; tidy code.