Fixed code in algorithms.stochastic.