Using Tv constants.
Removed Random.nextInt usages.
Merge remote branch 'head/issue-856'