Little changes for threading.