Memory leak bug related to random number generator fixed.