Turns out it was, you guessed it: lambdas.
Also changed the count variable to be atomic just to be safe.