Use inbounds in randperm/randcycle