Fix some things in new threading code.