Even more threading fixes