Fixed issue when minThreadsLeft = 0