minor fixes in threads