Fix bug with tick randomization.
Fix bug with tick randomization.

Before, if the tick frequency didn't divide the total tick interval, the
last tick could occur after the end of the tick interval. Now we cap the
randomization interval to the minimum of the total tick interval & the
tick frequency.

BranLwyd/rssdl,BranLwyd/rssdl