Minor tweaks to thread.pl