Fix bug for TotalAmount.