Make grep-index work when returning into an array

This feels like a work around for some obscure scoping issue.