Fixed one of the bugs in TrialCost