Randomization off by one error