Fixed issues with discount value calculating.