Improve thread finishing.