small fixes, threading