fixed unlinking bugs in tools