Fix card_hash and card_id generation issues.