fix bug in CardBag

Fix a bug in CardBag that could result in crashes and also incorrect
results.  The bug would result in duplicate cards appearing in the
cardbag.  Add another test case and fix an existing one.

Signed-off-by: Colin McCabe <cmccabe@alumni.cmu.edu>