Fix a long-standing bug where invalid receipts would be accepted.