thread fixes gdb fixes ctrulib fixes