#KJ-125 Fix threading tests. And some more corrections.