Modify upgrade routine to only include revoked and completed purchases in purchase_value and purchase_count. #2256