Fix and update the digmine and replace programs