Fixed weird defect whereby the DB would not be unlinked