Fixed some threadByID bugs.