Debug multithreading-related errors