Fix runs in threads