Added seed for random_shuffle; other bug fixes