Fixed stack handling in method for probability calculator.