Fix for Ctrl+C in multi-threaded mode