Adding threading test, and fixing a tiny CMake issue