Merge pull request #2549 from martin-frbg/fixthreadtest