Fix RNG bug

Whenever target_index was equal to word_index, no new random number was
generated.