Fixing "negative WaitGroup counter" bug.