Add multithreading and debug options.