Calculation was not working if the maximum code redemption was not set