Generate configuration before returning indices.

Otherwise they're blank, which is not what we're after. Don't want to regenerate them more than once though, hence the check.