Fixed bug when more threads than dictionary entries