small fixes to thread ids and counter; test/threads.jl runs