Fix bug in names being passed to index.