Remove some now useless code in ExpandThread and small cleanup in ThreadHiding.