Fix problems that will happen when a threaded runner is used