So we started with 10, you consumed 10 (5 subs of qty 2 each). So on line 130 you verified we had 5. So far so good. Then we set the quantity to: 5 (10 - 5 assuming sub.quantity.to_i == 10). So why is certificates returning only 2 now?