Fixed some threading issues.