various small fixes
fixed race conditions when removing unneeded threading