Fixed bug reported by Phil Steitz in which poorly placed casting was making all random methods return 0 :)