Al-Sha'bi narrates from Sayyiduna Zayd bin Thabit (may Allah be pleased with him) that the mukatab remains a slave as long as even one dirham remains due from him. Then he said to al-Sha'bi: Shurayh used to judge in this case that, when the mukatab dies, what remains due on his contract of manumission (mukatabah) is paid to his masters, and whatever remains goes to his heirs. He (al-Sha'bi) said: Shurayh judges in this by the judgement of Abdullah (bin Mas'ud, may Allah be pleased with him).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب المكاتب / 21643