patch segfault for target phrase caching. Only occurs when multithreading.