Fixed some more threading issues.