Cleanup and threading tests.