Fix bug in index races