Thread bugfix.