Fixed bug in random walk