Corrected use of threading for global matching.