Ibn Jurayj (may Allah have mercy on him) says that Ata' (may Allah have mercy on him) said: If you make a contract of manumission (mukatabah) with your slave and he has children, so that you have made the contract over all of them, and then their father or one of them dies, his value is to be deducted. If you set him or some of his sons free, then it is the same (that is, reduce the value).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب المكاتب / 21632